package com.lengxf.design;

/**
 * 具体中介者
 * By Lengxf
 */
public class ConcreteMediator extends Mediator {

    public Button addButton;

    public List list;

    public TextBox textBox;

    public ComboBox comboBox;


    @Override
    public void componentChanged(Component component) {
        if (component == addButton) {
            System.out.println("-单加增加按钮---");
            list.update();
            comboBox.update();
            textBox.update();
        } else if (component == list) {
            System.out.println("--从列表框选择客户--");
            comboBox.select();
            textBox.setText();
        } else if (component == comboBox) {
            System.out.println("--从组合框选择客户--");
            comboBox.select();
            textBox.setText();
        }

    }
}
